#ifndef QIMGTOPIXMAP_H
#define QIMGTOPIXMAP_H

#include "qrunnable.h"
#include "qthread.h"
#include "qimage.h"
#include "qpixmap.h"

class QImageToQPixmap : public QThread
{
	Q_OBJECT

public:
	void setImagePixmap(QImage *image, QPixmap *pixmap)
	{
		m_image = image;
		m_pixmap = pixmap;
	}


	void run()
	{
		*m_pixmap = QPixmap::fromImage(*m_image);
		emit updateImage(*m_pixmap);
	}
signals:
	void updateImage(QPixmap pixmap);

private:
	QImage *m_image;
	QPixmap *m_pixmap;
};

#endif